<%-- 
    Document   : Employee
    Created on : Aug 9, 2012, 3:52:08 PM
    Author     : VUHOLMES
--%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
 <%@ taglib prefix="s" uri="/struts-tags"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        
        <SCRIPT type="text/javascript">
            alert("edit...........");
            document.getElementById("btnAdd").disabled = true;
            document.getElementById("btnSave").disabled = false;
        </SCRIPT>
        
    </head>
    <body>
        <h3> Demo Struts 2.0 Framework in J2EE </h3>
        <s:fielderror/>
        <form id="frmEmployee" name="Employee" method="post" theme="simple">
            <table border="1" width="100%">
                <tr>
                    <td>ID</td>
                    <td style="width: 20%">Name</td>
                    <td style="width: 10%">Sex</td>
                    <td style="width: 15%">Birthday</td>
                    <td style="width: 15%">City</td>
                    <td style="width: 30%">Email</td>
                    <td style="width: 10%">Action</td>
                </tr>
                <%-- list is property --%>
                <s:iterator value="employeeList">
                    <tr>
                        <td>
                            <s:property value="id"/>
                        </td>
                        <td>
                            <s:property value="name" />
                        </td>
                        <td>
                            <s:property value="sex"/>
                        </td>
                        <td align="center">
                            <s:property value="birthday" />
                        </td>
                        <td>
                            <s:property value="city" />
                        </td>
                        <td>
                            <s:property value="email" />
                        </td>
                        <td align="center">
                            <s:url id="urlDelete" action="EmployeeDelete">
                                <s:param name="id" value="%{id}"/>
                            </s:url>
                            <s:a href="%{urlDelete}">Delete</s:a>
                            <s:url id="urlEdit" action="EmployeePrepareUpdate">
                                <s:param name="id" value="%{id}"/>
                            </s:url>
                            <s:a href="%{urlEdit}" onclick="return edit();">Edit</s:a>
                        </td>
                    </tr>
                </s:iterator>

            </table>
        </form>

    </body>
</html>
